popovermenu: Don't put a separator before the first section
authorMatthias Clasen <mclasen@redhat.com>
Tue, 28 Apr 2020 00:26:02 +0000 (20:26 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 Apr 2020 00:27:39 +0000 (20:27 -0400)
When we have section titles, we were not hiding the
separator before the first section as we should;
fix this.

Fixes: #2672
gtk/gtkmenusectionbox.c

index e6a55fae559799fc240f6f20c1baa6a0c9a9fc1c..6a36ae7510dbcdf398689f0b47680b7caaf98cb9 100644 (file)
@@ -135,6 +135,13 @@ gtk_menu_section_box_sync_separators (GtkMenuSectionBox *box,
 
   gtk_widget_set_margin_top (GTK_WIDGET (box->item_box), should_have_top_margin ? 10 : 0);
 
+  if (has_label)
+    {
+      GtkWidget *separator = gtk_widget_get_first_child (box->separator);
+
+      gtk_widget_set_visible (separator, n_items_before > 0);
+    }
+
   if (should_have_separator == has_separator)
     return;